package com.hospital.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

@Data
@ApiModel(description = "患者注册DTO")
public class PatientRegisterDTO {
    @ApiModelProperty("姓名")
    @NotBlank(message = "身份证号不能为空")
    private String name;

    @ApiModelProperty("性别")
    @Pattern(regexp = "^(男|女)$", message = "性别只能是男或女")
    private String gender;

    @ApiModelProperty("地址")
    @NotBlank(message = "地址不能为空")
    private String address;

    @ApiModelProperty("电话")
    @NotBlank(message = "电话号码不能为空")
    @Pattern(regexp = "^\\d{11}$", message = "电话号码必须为11位数字")
    private String phoneNumber;

    @ApiModelProperty("科室ID")
    @NotNull(message = "科室不能为空")
    private Long deptId;

    @ApiModelProperty("诊断信息")
    @NotBlank(message = "诊断不能为空")
    private String diagnosis;

    @ApiModelProperty("入院时间")
    @NotNull(message = "入院时间不能为空")
    private LocalDateTime admissionTime;
}
